package com.luanye.enjoy.controller;

import com.luanye.enjoy.dto.ConditionDTO;
import com.luanye.enjoy.service.TopicService;
import com.luanye.enjoy.vo.RespBean;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/topic")
@AllArgsConstructor
public class TopicController {

    private final TopicService topicService;

    @GetMapping("/list")
    public RespBean getTopicList(){
        return RespBean.success(topicService.list());
    }

    @PostMapping("/custom")
    public RespBean customTopic(@RequestBody ConditionDTO dto){
        return topicService.customTopic(dto);
    }

    @GetMapping("/hot")
    public RespBean getHotTopic(){
        return topicService.getHotList();
    }


}
